<?php
include_once 'conn.php';
$sql = "select name,vote from object order by vote desc ";
$result = mysqli_query($conn, $sql);
/*$a = array(
    'name' => array("衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"),
    'data'=>array(5, 20, 36, 10, 10, 20));*/
$name = array();
$data = array();
while ($info = mysqli_fetch_array($result)){
    array_push($name,$info['name']);
    array_push($data,$info['vote']);
}
$a = array('name'=>$name,'data'=>$data);
echo json_encode($a);


